#include <iostream>
#include <string>

//#define NDEBUG
using namespace std;

int main()
{
    string strold;
    string strnew;
    bool bsame;
    strold = strnew = "";
    bsame = false;
    while(cin >> strnew)
    {
        if(strnew == strold)
        {
            bsame = true;
            cout << strnew << endl;
            break;
        }
        #ifndef NDEBUG
            cout << strnew << endl;
        #endif
        strold = strnew;
    }
    if (!bsame)
        cout << "no same" << endl;
    return 0;
}
